package com.cnap.utils;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * <类文件描述>
 *
 * @author xc
 **/
class CommonUtilsTest {

    @Test
    void getPrintSizeForKB() {
        String result = CommonUtils.getPrintSize(100);
        Assertions.assertTrue(result.contains("KB"));
    }

    @Test
    void getPrintSizeForMB() {
        String result = CommonUtils.getPrintSize(2048);
        Assertions.assertTrue(result.contains("MB"));
    }

    @Test
    void getPrintSizeForGB() {
        String result = CommonUtils.getPrintSize(2048000);
        Assertions.assertTrue(result.contains("GB"));
    }

    @Test
    void getNamespaceByUserNameAndAppName() {
        Assertions.assertDoesNotThrow(()->{
            CommonUtils.getNamespaceByUserNameAndAppName("admin", "应用1");
        });
    }
}